# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
from itertools import product

name = "境内高原游保险"
mysql = MysqlClient()
plan = {
    "planA": {
        "days": ["1d"],
        "people_count": ["1"],
        "accident_death": ["100000"],
        "accident_medical": ["10000"],
        "exigency_back": ["80000"],
        "relate_mourn": ["0"],
        "death_back": ["20000"],
        "price": ["3.50"]
    },
    "planB": {
        "days": ["1d"],
        "people_count": ["1"],
        "accident_death": ["300000"],
        "accident_medical": ["30000"],
        "exigency_back": ["120000"],
        "relate_mourn": ["5000"],
        "death_back": ["30000"],
        "price": ["12.00"]
    },
}
for k in plan:
    for v in product(plan[k]["days"],plan[k]["people_count"],plan[k]["accident_death"],plan[k]["accident_medical"],plan[k]["exigency_back"],plan[k]["relate_mourn"],plan[k]["death_back"],plan[k]["price"]):
        data = Helper.formatProductInfo( plan[k],v )
        data["name"] = name
        data["company"] = "中国人民保险"
        Helper.mergeTable(name,mysql,data )
